export const schema = {
    type: "page",
    title: "团队信息查看",
    body: [
        {
            type: "nav",
            stacked: false,
            links: [
                {
                    label: "查看",
                    to: "/team/view/${id}"
                },
                {
                    label: "编辑",
                    to: "/team/edit/${id}",
                    // acl: "team:edit",
                    visibleOn: 'acl.can("team:edit")',
                },
                {
                    label: "权限配置",
                    to: "/team/acl/${id}",
                    visibleOn: 'acl.can("team:setting")',
                    // acl: "team:setting"
                }
            ]
        },

        {
            type: "wrapper",
            className: "b-l b-b b-r bg-white no-padder",
            body: {
                className: "m-t-md",
                title: "",
                panelClassName: "no-border no-shadow",
                initApi: "/api/team/${id}",
                redirect: "/team/list",
                submitText: "",
                name: "theform",
                type: "form",
                mode: "horizontal",
                controls: [
                    {
                        type: "static-image",
                        name: "logo",
                        label: "Logo",
                        popOver: {
                            title: "",
                            body:
                            '<div class="w-xx-xxl"><img class="w-full" src=${logo} /></div>'
                        }
                    },

                    {
                        type: "divider"
                    },

                    {
                        type: "static",
                        name: "name",
                        label: "团队名称",
                        required: true
                    },

                    {
                        type: "divider"
                    },

                    [
                        {
                            type: "static",
                            name: "type",
                            label: "团队类型",
                            tpl: "<span class='label label-info'>${type}</span>"
                        },

                        {
                            type: "static",
                            name: "service_target",
                            label: "服务对象",
                            // tpl: "<span class='label label-info'>${service_target}</span>"
                            tpl: '<% data.service_target && data.service_target.split(",").map(function(name) {%><span class="label label-info m-r-xs"><%= name %></span><%}); %>'
                        }
                    ],

                    {
                        type: "divider"
                    },

                    [
                        {
                            type: "static",
                            name: "contact_name",
                            label: "联系人"
                        },

                        {
                            type: "static",
                            name: "contact_phone",
                            label: "联系电话"
                        }
                    ],

                    {
                        type: "divider"
                    },

                    {
                        type: "static",
                        name: "contact_email",
                        label: "邮箱"
                    },

                    {
                        type: "divider"
                    },

                    {
                        type: "static",
                        name: "address",
                        label: "团队地址",
                        tpl:
                        "${address.province} ${address.city} ${address.district} ${address.address}"
                    },


                    {
                        type: "divider"
                    },

                    {
                        type: "static-image",
                        name: "certificate_photo",
                        imageWrapClassName: 'thumb-lg m-r-xs',
                        multiple: true,
                        label: "上传资质",
                        popOver: {
                            title: "",
                            body:
                            '<div class="w-xx-xxl"><% data.certificate_photo && data.certificate_photo.split(",").map(function(src) { %><img class="w-full m-b-sm" src="<%= src %>" /><% }) %></div>'
                        }
                    },
                    {
                        type: "divider"
                    },

                    {
                        type: "static-image",
                        name: "team_photo",
                        label: "上传团队照片",
                        multiple: true,
                        imageWrapClassName: 'thumb-lg m-r-xs',
                        popOver: {
                            title: "",
                            body:
                            '<div class="w-xx-xxl"><% data.team_photo && data.team_photo.split(",").map(function(src) { %><img class="w-full m-b-sm" src="<%= src %>" /><% }) %></div>'
                        }
                    },

                    {
                        type: "divider"
                    },

                    {
                        type: "static",
                        name: "slogan",
                        label: "团队口号",
                        maxLength: 20
                    },

                    {
                        type: "divider"
                    },

                    {
                        type: "static",
                        name: "abstract",
                        label: "团队简介"
                    }
                ]
            }
        }
    ]
};
